import request from '@/utils/request'

// 预览PPT
export const previewPPT = (file) => {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/pptCustomTasks/preview',
    method: 'post',
    data: formData,
  })
}

//直接生成视频
export const generateVideo = (data) => {
  return request({
    url: '/pptTasks/createTask',
    method: 'post',
    data
  })
}

//自定义生成视频
export const customGenerateVideo = (data) => {
  return request({
    url: '/pptCustomTasks/createCustomTask',
    method: 'post',
    data
  })
}
//获取直接生成任务进度
export const getDirectTaskStatus = (taskId) => {
  return request({
    url: `/pptTasks/status/${taskId}`,
    method: 'get'
  })
}
//获取自定义生成任务进度
export const getCustomTaskStatus = (taskId) => {
  return request({
    url: `/pptCustomTasks/taskStatus/${taskId}`,
    method: 'get'
  })
}